public class InsertSort {
    public static void myInsertSort(int[] array) {
        for (int i = 1; i < array.length ; i++) {
            int j = i-1;
            int tmp = array[i];
            while(j >= 0) {
                if (array[j] >= tmp) {
                    array[j+1] = array[j];
                    j--;
                }else {
                    break;
                }
            }
            array[j+1] = tmp;
        }
    }
}
